package com.example.academicsystem.server.dao;

import com.example.academicsystem.pojo.dto.GradeDto;
import com.example.academicsystem.pojo.dto.GradeInsertDto;
import com.example.academicsystem.pojo.dto.TeacherCourseDto;
import com.example.academicsystem.pojo.dto.TeacherGradeUpdateDto;
import com.example.academicsystem.pojo.vo.CourseVo;
import com.example.academicsystem.pojo.vo.GradeVo;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TeacherMapper {

    Page<CourseVo> coursePageQuery(List<String> courseIdList, String courseName);

    @Select("select course_id from course_teacher where teacher_id=#{id}")
    List<String> teacherCourseSelectAll(String id);

    @Delete("delete from course_teacher where course_id=#{courseId} and teacher_id=#{teacherId}")
    void teacherCourseDelete(TeacherCourseDto teacherCourseDto);

    @Insert("insert into course_teacher(course_id,teacher_id) values (#{courseId},#{teacherId})")
    void teacherCourseInsert(TeacherCourseDto teacherCourseDto);

    Page<GradeVo> gradePageQuery(GradeDto gradeDto);

    void teacherGradeInsert(GradeInsertDto gradeInsertDto);

    void teacherGradeUpdate(TeacherGradeUpdateDto teacherGradeUpdateDto);
}
